import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

import Home from '../views/Home.vue'
// RouteRecordRaw  : 用来描述路由的接口

const routes:Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path:"/cart",
    name:"Cart",
    component:()=>import("../views/cart/index.vue")
  },
   {
    path:"/list",
    name:"list",
    component:()=>import("../views/list/index.vue")
  },
   {
    path:"/fly",
    name:"fly",
    component:()=>import("../views/fly/index.vue")
  },
  {
    path:"/mine",
    name:"mine",
    component:()=>import("../views/mine/index.vue")
  },
    {
    path:"/hello",
    name:"hello",
    component:()=>import("../views/hello/index.vue")
  },
  { 
    path:"/tsfn",
    name:"tsfn",
    component:()=>import("../views/tsfn/index.vue")
  },
  {
    path:"/tstool",
    name:"tstool",
    component:()=>import("../views/tstool/index.vue")
  },
  {
    path:"/other",
    name:"other",
    component:()=>import("../views/tsother/index.vue")
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
